<?php
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
global $_G;

require_once DISCUZ_ROOT . 'source/plugin/unifiedpay/function/function_base.php';

if(strpos($_SERVER['HTTP_USER_AGENT'], 'AlipayClient')!==false){
	$result = unifiedpay_plugin_api('alipay', 'oauth');
	$openid_title = lang('plugin/unifiedpay', 'openid_alipay_title');
}else{
	$result = unifiedpay_plugin_api('wechat', 'oauth');
	$openid_title = lang('plugin/unifiedpay', 'openid_wechat_title');
}
if($result['code'] != 200) {
	showmessage($result['message'], '', array(), array('showdialog' => true));
}

$openid_content = $result['data'];
include template('unifiedpay:openid');